home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / comm1 / portstts.lha / PORTStatus.rexx < prev    next >
OS/2 REXX Batch file  |  1996-04-08  |  8KB  |  103 lines

  1. /**************************************************************************\
  2.          $VER: Port Status, v5.1 (08-Apr-96) by Star Gazer!
  3.  
  4.    Star Streams BBS    (214) 938-7115   FIDO  1:124/6517    PostCard Ware!
  5. \**************************************************************************/
  6. options results;signal on SYNTAX;signal on ERROR;signal on IOERR;BBSIDENTIFY NAME;SYS=result;BBSIDENTIFY SYSOP;NAM=result;se=sendstring;gc=getchar;qu=query
  7. tr=transmit;gu=getuser;gu 23;cp=result;port=cp;gu 1;handle=result;gu 46;tday=result;gu 57;lt=result;gu 15;ac=result;gu 11;lc=result;gu 95;cn=result;gu 7;tl=result;gu 12;ct=result;ver=5.1
  8. gu 22;tc=result;gu 1500416;fc=result;gu 1200536;cty=result;gu 1200680;tcd=result;ucl=tcd-cty;if ucl<0 then ucl='caUNLIMITED';getuser 1100454;oldmore=result;changewhere'PORTStatus 'ver;oldwh=result
  9. xa=1 /* Show SysOp Status?     (0=NO/1=YES) */
  10. xb=1 /* Show NEW USER Status?  (0=NO/1=YES) */
  11. xc=1 /* Show File Area Status? (0=NO/1=YES) */
  12. xd=1 /* Show Game Area Status? (0=NO/1=YES) */
  13. xe=1 /* Show Base Area Status? (0=NO/1=YES) */
  14. xf=31 /* Access level of Sysop */
  15. xg=0 /* User option to view port information 0=Force View/1=User Picks */
  16. if xg=1 then do;tr;se 'ceView your port status? cc[caYcfescf/c9ncfocc] cd> ';gc;vyn=upper(result)
  17. if vyn='N' then do;tr 'c9Now1';tr;tr 'ceThank You for using cfPORTc9Status cb'ver;setobject oldmore;putuser 1100454;changewhere oldwh;exit;end;else tr 'cfYesw1';end
  18. MAIN:;tr 'f1cfPORTc9Status cbV'ver;tr;tr 'cfGood 'tday',ce' handle'cf... Thank You for calling ce'sys' cfBBS.';tr
  19. tr 'cfYour call has been answered by ccPort #'cp' cfon ce'lt'.'
  20. tr 'cfYour first call to ce'sys' cfwas on ce'fc'.'
  21. call CNUM(cn);tr 'cfYour last call was on ce'lc'cf. You are caller cb#'a'.'
  22. tr 'cfIt is now ce'ct' cfwith ceL70 7}XR 1}V71}.V70} cfminutes left this call.'
  23. call CNUM(tc);tr 'cfYou have made c9'a' cfcalls with c9'cty' cfmade today and have c9'ucl' cfleft.';tr 
  24. if xa=1 then do;call CHECK;gu 2121864+port*24;CanChat=BitTST(d2c(result),0)
  25. if CanChat=0 then SS='c9NOT AVAILABLE cffor Chat.';if CanChat=1 then SS='caAVAILABLE cffor Chat.'
  26. tr 'cfThe SysOp cc(ce'NAM'cc) cfis 'SS;tr;end
  27. if xb=1 then do;call CHECK;gu 2121864+port*24;NewUser=BitTST(d2c(result),1)
  28. if NewUser=1 then NU='c9NOT Accepting cfNew Users';if NewUser=0 then NU='caAccepting cfNew Users'
  29. tr 'ce'SYS' cfBBS is 'NU' on this port.';tr;end
  30. if xc=1 then do;call CHECK;gu 2121864+port*24;UDBaseS=BitTST(d2c(result),2)
  31. if UDBaseS=0 then UD='caOPEN';if UDBaseS=1 then UD='c9CLOSED'
  32. tr 'cfThe File Area iscb: 'UD;end
  33. if xd=1 then do;call CHECK;gu 2121864+port*24;PFilesS=BitTST(d2c(result),3)
  34. if PFilesS=0 then PF='caOPEN';if PFilesS=1 then PF='c9CLOSED'
  35. tr 'cfThe Game Area iscb: 'PF;end
  36. if xe=1 then do;call CHECK;gu 2121864+port*24;MsgBase=BitTST(d2c(result),4)
  37. if MsgBase=0 then MB='caOPEN';if MsgBase=1 then MB='c9CLOSED'
  38. tr 'cfThe Base Area iscb: 'MB;end;if ac=xf then do;tr;call SYSMEN;end
  39. tr;tr;se 'cfPress cc[ceAny Keycc] cfto Continue...g1';setobject oldmore;putuser 1100454;tr ' ceThank You for using cfPORTc9Status cb'ver;setobject oldmore;putuser 1100454;changewhere oldwh;exit
  40. SYSMEN:tr 'cePort    cfPort Status     ceSysOp Around?   cfNewUsers  ceFileArea  cfGameArea  ceBaseArea'
  41. tr 'cc=============================================================================='
  42. it.i=100;gu 2121862+it.i*24;load=result;if load<1 then ld='Closed';else ld='Loaded/'
  43. getportid it.i;tpt=result;if tpt=-1 then do;ld1=ld'Idle12345';end;if ld='Closed' then ld1='Closed Port'
  44. if it.i<100 then do;getportid it.i;id=result;if id>-1 then do;loadscratch id;savescratch (-id);getscratch 1;handle.it=result;ld1=handle.it;end;end
  45. maygetchar;die=upper(result);if die~="NOCHAR" then do;prompt 1 YESNO "cdContinue listing cc[caYcfescc/c9ncfocc] ";CMD=upper(result);if CMD="###PANIC" then exit;if CMD~='YES' then call MAIN;gu 2121864+it.i*24;CanChat=BitTST(d2c(result),0);end
  46. if CanChat=0 then SS='Not Available';else SS='Available'
  47. call CHECK;gu 2121864+it.i*24;NewUser=BitTST(d2c(result),1)
  48. if NewUser=1 then NU='No ';else NU='Yes'
  49. call CHECK;gu 2121864+it.i*24;UDBaseS=BitTST(d2c(result),2)
  50. if UDBaseS=0 then UD='Yes';else UD='No '
  51. call CHECK;gu 2121864+it.i*24;PFilesS=BitTST(d2c(result),3)
  52. if PFilesS=0 then PF='Yes';else PF='No '
  53. call CHECK;gu 2121864+it.i*24;MsgBase=BitTST(d2c(result),4)
  54. if MsgBase=0 then MB='Yes';else MB='No '
  55. if it.i=100 then ld1='GLOBAL INFO'
  56. se 'Ccf'left(it.i,6);se left('Cce'ld1,18);se 'Ccf'left(SS,13);se 'Cce'NU;se 'Ccf'UD;se 'Cce'PF;se 'Ccf'MB;tr
  57. tr 'cc=============================================================================='
  58. call NOMORE;tr 'cfSysOp Menuca: cf[cbAny c9KEY cbto cfPAUSE/ABORT cblisting in progresscf] ceEnter cfto Exit.';qu 'cfEnter Range c9cc(cbExamplecf:cd -2 19- 4 7-9 11.13.15,17cc)cf: c9' ; tot=PARSE(result,0,100,'s')
  59. if tot=0 then do;tr;tr 'ceThank You for using cfPORTc9Status cb'ver;setobject oldmore;putuser 1100454;changewhere oldwh;exit;end
  60. tr;se 'cfSkip UnLoaded Ports cc(cf[caYescf]ce/c9ncc)cf: ';gc;skip=result;call CHECK;if skip='N' then do;tr 'c9No';end;else tr 'caYes'
  61. tr;tr 'cePort    cfPort Status     ceSysOp Around?   cfNewUsers  ceFileArea  cfGameArea  ceBaseArea'
  62. tr 'cc=============================================================================='
  63. do i=1 to tot;gu 2121862+it.i*24;load=result;if skip~='N'&load<1 then iterate;if load<1 then ld='Closed';else ld='Loaded/'
  64. getportid it.i;tpt=result;if tpt=-1 then do;ld1=ld'Idle12345';end;if ld='Closed' then ld1='Closed Port'
  65. if it.i<100 then do;getportid it.i;id=result;if id>-1 then do;loadscratch id;savescratch (-id);getscratch 1;handle.it=result;ld1=handle.it;end;end
  66. maygetchar;die=upper(result);if die~="NOCHAR" then do;prompt 1 YESNO "cdContinue listing cc[caYcfescc/c9ncfocc] ";CMD=upper(result);if CMD="###PANIC" then exit;if CMD~='YES' then call MAIN;gu 2121864+it.i*24;CanChat=BitTST(d2c(result),0);end
  67. if CanChat=0 then SS='Not Available';else SS='Available'
  68. call CHECK;gu 2121864+it.i*24;NewUser=BitTST(d2c(result),1)
  69. if NewUser=1 then NU='No ';else NU='Yes'
  70. call CHECK;gu 2121864+it.i*24;UDBaseS=BitTST(d2c(result),2)
  71. if UDBaseS=0 then UD='Yes';else UD='No '
  72. call CHECK;gu 2121864+it.i*24;PFilesS=BitTST(d2c(result),3)
  73. if PFilesS=0 then PF='Yes';else PF='No '
  74. call CHECK;gu 2121864+it.i*24;MsgBase=BitTST(d2c(result),4)
  75. if MsgBase=0 then MB='Yes';else MB='No '
  76. if it.i=100 then ld1='GLOBAL INFO'
  77. se 'Ccf'left(it.i,6);se left('Cce'ld1,18);se 'Ccf'left(SS,13);se 'Cce'NU;se 'Ccf'UD;se 'Cce'PF;se 'Ccf'MB;tr
  78. end i;tr 'cc==============================================================================';tr 'cfPress cc[ceAny Keycc] cfto Continue...g1';call MAIN
  79. NOMORE:;sendstring 'L1100454 #0}';return
  80. PARSE: procedure expose it.; arg rng,min,max,srt
  81.    it.='';c=0;it=translate(rng,'  ','.,')
  82.     do a=1 to words(it);c=c+1;it.c=word(it,a)
  83.         if index(it.c,'-')>0 then do;parse var it.c x'-'y
  84.         if y='' then y=max;if x='' then x=min
  85.         if x>y then do;d=x;x=y;y=d;end
  86.         if x<min|y>max|~datatype(x,'W')|~datatype(y,'W') then do;c=c-1;iterate;end
  87.         do b=x to y;it.c=b;c=c+1;end;c=c-1;end
  88.     else if it.c<min|it.c>max|~datatype(it.c,'W') then do;c=c-1;iterate;end;end
  89.     do i=1 to c;it.0=it.0||it.i' ';end
  90.   return c
  91. CNUM: /* Comma Number Parser (Place commas inside numbers) */
  92.     parse arg a;b=length(a);if b=4 then a=insert(',',a,1,1)
  93.     if b=5 then a=insert(',',a,2,1);if b=6 then a=insert(',',a,3,1)
  94.     if b=7 then do;a=insert(',',a,1,1);a=insert(',',a,5,1);end
  95.   return
  96. CHECK:;if result~='###PANIC' then return
  97. tr 'f1n9ccPORTStatusn2c9Loss of Carrier!'
  98. logentry 'No Carrier in PORTStatus!';bufferflush;setobject oldmore;putuser 1100454;changewhere oldwh;exit
  99. SYNTAX:;ERROR:;IOERR:;e1=' Error: 'rc' ('errortext(rc)')';e2='  Line: 'left(sigl,4)'File:'
  100.     getuser 1311992;a=result;getuser 1311960;b=result;c='"'a||b'"';e2=e2' 'c;tr e1;tr e2;logentry e1;logentry e2
  101.     e=sourceline(sigl);do while e~='';e3='Source: 'left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush;setobject oldmore;putuser 1100454;changewhere oldwh;exit
  102. /* EOF */
  103.